// DriveNotes. Copyright (c) 2011, Andrei Senchuk. All rights reserved.
package net.taviscaron.drivenotes.shared.model.entity;

import java.io.Serializable;

/**
 * Car entity object
 * @author Andrei Senchuk
 */
public class Car implements Serializable {
    public enum EngineType {
        DIESEL, PETROL, PETROL_GAS
    }
    
    private Long id;
    private User owner;
    private String brand;
    private String model;
    private Integer year;
    private EngineType engineType;
    private Integer engineVolume;
    private Integer color;
    private Integer odometrValue;
    private Boolean odometrFollowed;
    private String attributes;

    public Car() {
    }

    public String getAttributes() {
        return attributes;
    }

    public void setAttributes(String attributes) {
        this.attributes = attributes;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public Integer getColor() {
        return color;
    }

    public void setColor(Integer color) {
        this.color = color;
    }

    public EngineType getEngineType() {
        return engineType;
    }

    public void setEngineType(EngineType engineType) {
        this.engineType = engineType;
    }

    public Integer getEngineVolume() {
        return engineVolume;
    }

    public void setEngineVolume(Integer engineVolume) {
        this.engineVolume = engineVolume;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public Boolean getOdometrFollowed() {
        return odometrFollowed;
    }

    public void setOdometrFollowed(Boolean odometrFollowed) {
        this.odometrFollowed = odometrFollowed;
    }

    public Integer getOdometrValue() {
        return odometrValue;
    }

    public void setOdometrValue(Integer odometrValue) {
        this.odometrValue = odometrValue;
    }

    public User getOwner() {
        return owner;
    }

    public void setOwner(User owner) {
        this.owner = owner;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    @Override
    public String toString() {
        return String.format("Car #%d: owner: [%s]; brand: %s; model: %s; " +
                "year: %d; engineType: %s; engineVolume: %d; color: 0x%08x; " +
                "odometrValue: %d; odometrFollowed: %s; attributes: %s", id, owner,
                brand, model, year, engineType, engineVolume, color, odometrValue,
                odometrFollowed, attributes);
    }
}
